﻿
Imports System.Data.SqlClient

Partial Class _Default
    Inherits System.Web.UI.Page

    Protected Sub LinkButton6_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LinkButton6.Click
        Response.Redirect("login.aspx")
    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Dim cn As New SqlConnection(ConfigurationSettings.AppSettings("conn").ToString())
        Try
            Dim sqlcmd As String = "update users set logindate='" + DateTime.Now + "' where username='" + Session("username") + "'"
            cn.Open()
            Dim cmd As SqlCommand = New SqlCommand(sqlcmd, cn)
            cmd.ExecuteNonQuery()
            cn.Close()
        Catch ex As Exception
            cn.Close()
        End Try
        Session("username") = "Guest"
        Session("name") = ""

    End Sub
End Class
